package com.zx.mq.hello;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
public class HelloController {

    @Autowired
    HelloSender helloSender;

    @GetMapping("/hello/{num}")
    public String hello(@PathVariable int num){
        for(int i=0;i<num;i++){
            helloSender.send(new Date().toString());
        }

        return "ok";
    }
}
